<script>
import img from '@/assets/logo.png';
export default{
    data(){
        return {
            visible:false,
            loading:false,
            data:{
                type:'video',//audio video img
                // src:'http://qdzsucaiku.oss-cn-guangzhou.aliyuncs.com/uploads/adminctr_confset/2022-03-29/21b3e13d0b2df23c167d6070464d372b8e337599.png',
                src:'http://qdzsucaiku.oss-cn-guangzhou.aliyuncs.com/uploads/adminctr_confset/2022-03-29/8e8e342acd2ee996effe4191d504a76b2f4c8701.mp4',
                list:[],
            },
        }
    },
    mounted(){
        this.$nextTick(()=>{
            let tag = document.createElement(this.data.type);
            let iframe = document.querySelector('#playiframe');
            let iframeboxy = iframe.contentWindow.document.querySelector('body');
            iframeboxy.style.margin=0;
            iframeboxy.appendChild(tag);
            tag.src=this.data.src;
            tag.style.width='100%'
            tag.autoplay=true;
            tag.controls=true;
            tag.loop=true;
            tag.onload=function(){
                // tag.play();
                // iframe.height=iframe.contentWindow.document.body.scrollHeight+20
            }
        });
    },
    methods:{
        show(show,param){
            this.visible=show;
			if(show){
                // this.data=this.param=param;
			}
        },
    },
}
</script>
<template>
    <a-modal
		v-model:visible="visible"
		width="450px"
		title="播放"
		:maskClosable="false"
		@ok="send"
		cancelText="取消"
		okText="提交"
		:confirmLoading="loading"
        :bodyStyle="{padding:0}"
        :footer="null"
        :forceRender="true"
        :zIndex="1001"
	>
        <div id="a1"></div>
        <iframe id="playiframe" frameborder="0" width="100%" height="350"></iframe>
    </a-modal>
</template>